home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 350 < prev    next >
Internet Message Format  |  1996-08-06  |  1KB

  1. Path: solon.com!not-for-mail
  2. From: seebs@solon.com (Peter Seebach)
  3. Newsgroups: comp.std.c,comp.lang.c.moderated
  4. Subject: Re: Integral promotion.
  5. Date: 21 Feb 1996 19:15:45 -0600
  6. Organization: Usenet Fact Police (Undercover)
  7. Sender: clc@solutions.solon.com
  8. Approved: clc@solutions.solon.com
  9. Message-ID: <4ggg41$91j@solutions.solon.com>
  10. References: <4ggbcq$81c@solutions.solon.com>
  11. NNTP-Posting-Host: solutions.solon.com
  12.  
  13. In article <4ggbcq$81c@solutions.solon.com>,
  14. Jens M Andreasen  <jens-and@dsv.su.se> wrote:
  15. >I admit that I am confused too. So in this case the compiler should issue a 
  16. >warning for { short x = 0; x++; } since "x++" equals "x = x + 1" and both 
  17. >"x" and "1" are promoted to integers, and there could therefore be a 
  18. >potential loss of precision because "sizeof(int) > sizeof(short)", but no 
  19. >precision could have been lost if int and short had been the same (small) 
  20. >size ?? <phew>
  21.  
  22. x++ is not the same as "x = x + 1".  "++x" nearly is.
  23.  
  24. -s
  25. -- 
  26. Peter Seebach - seebs@solon.com - Copyright 1995 Peter Seebach.
  27. C/Unix wizard -- C/Unix questions? Send mail for help.  No, really!
  28. FUCK the communications decency act.  Goddamned government.  [literally.]
  29. The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.txt
  30.